/**********************************************************************************************/
/* FBL_Util_Path.h																			  */
/*                                                                       					  */
/* Copyright Paradigma, 1993-2006                                        					  */
/* All Rights Reserved.                                                 					  */
/**********************************************************************************************/

#ifndef _FBL_Util_Path_h
	#define _FBL_Util_Path_h
#pragma once

#include <VShared/FBL/publ/Headers/FBL.h>

#include <VShared/FBL/publ/Headers/FBL_pre_header.h>


/**********************************************************************************************/
FBL_Begin_Namespace

/**********************************************************************************************/
#if FBL_WIN
	const UChar PATH_DELIMITER_U = UChar('\\');
#endif	

#if FBL_MAC && !__MACH__ 
	const UChar PATH_DELIMITER_U = UChar(':');
#endif

#if __MACH__ || FBL_UNIX
	const UChar PATH_DELIMITER_U = UChar('/');
#endif


/**********************************************************************************************/
// Extract from a full path name of file. For each platform this function uses its delimiter.
//
FBL_SHARED_EXP const UChar*	ExtractNameFromFullPath( const UChar* inFullPath, UChar inDelim = 0 );


/**********************************************************************************************/
/*
void MakePathInTheSameFolder( 
		FILE_PATH* 	inOtherFile, 	// file wich we want to use to get folder. Usually a db file.
		FILE_PATH* 	outPath, 		// new path
		char* 		inFileName );	// new name for that path
*/


/**********************************************************************************************/
#if FBL_MAC //&& !FBL_CLIENT

FBL_SHARED_EXP	OSErr 		Path2Spec( 
								const char*		inFullPath, 
								FSSpec*			inSpec );

FBL_SHARED_EXP	OSErr 		FSMakePath(
								SInt16 			volRefNum,
								SInt32 			dirID,
								ConstStr255Param name,
								char*			outPath,
								ulong 			inmaxPathSize );

	// ---------------------
	// "More Files" code:

FBL_SHARED_EXP	OSErr 		GetCatInfoNoName( 
								short vRefNum, 
								long dirID,  
								ConstStr255Param name, 
								CInfoPBPtr pb);

FBL_SHARED_EXP	OSErr 		GetDirectoryID(
								short vRefNum,
								long dirID,
								ConstStr255Param name,
								long *theDirID,
								bool *isDirectory);

FBL_SHARED_EXP	OSErr 		FSpGetDirectoryID(
								const FSSpec* inSpec,
								long *theDirID,
								bool *isDirectory);

FBL_SHARED_EXP	OSErr 		FSpGetFullPath(
								const FSSpec *spec,
								short *fullPathLength,
								Handle *fullPath );

FBL_SHARED_EXP OSErr 		FSCheckLock(
								const FSRef *ref );

#endif // FBL_MAC //&& !FBL_CLIENT


/**********************************************************************************************/
#if FBL_MAC_MACHO

FBL_SHARED_EXP	OSErr 				FSMakeFSRef(
								FSVolumeRefNum volRefNum,
								SInt32 dirID,
								ConstStr255Param name,
								FSRef *ref);

#endif // FBL_MAC_MACHO


/**********************************************************************************************/
FBL_End_Namespace

#include <VShared/FBL/publ/Headers/FBL_post_header.h>

#endif // _FBL_Util_Path_h


